import request from '@/utils/request.js'

// 获取全部频道列表
export const getAllChannels = () => {
  return request({
    // url: '/app/v1_0/channels'
    url: '/v1_0/channels'
  })
}
/**
 * 新增频道
 * @param {*} channel { id, seq }
 * @returns promise
 */
export const addUserChannel = channel => {
  return request({
    // url: '/app/v1_0/user/channels',
    url: '/v1_0/user/channels',
    method: 'PATCH',
    data: {
      channels: [channel]
    }
  })
}

// 删除指定用户频道
export const deleteUserChannel = id => {
  return request({
    url: '/v1_0/user/channels/' + id,
    method: 'DELETE'
  })
}
